package com.dwj.auto.comment.common.security;

import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * @ClassName UserPermissionEvaluator
 * @Description 权限校验处理器
 * @Author dwjian
 * @Date 2020/7/12 10:16
 */
@Component
public class UserPermissionEvaluator implements PermissionEvaluator {

    @Override
    public boolean hasPermission(Authentication authentication, Object targetUrl, Object permission) {
        System.out.println(authentication);
        System.out.println(targetUrl);
        System.out.println(permission);
        return false;
    }

    @Override
    public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission) {
        System.out.println(authentication);
        System.out.println(targetId);
        System.out.println(targetType);
        System.out.println(permission);
        return false;
    }
}
